POV-Ray : Newsgroups : povray.general : Spline problem : Re: Spline problem Server Time
19 Nov 2024 18:16:37 EST (-0500)
  Re: Spline problem  
From: Warp
Date: 19 Jan 2002 16:03:10
Message: <3c49df0d@news.povray.org>
Andrew <ast### [at] hotmailcom> wrote:
: had wondered why commas weren't necessary.

  The main reason is backwards compatibility, but there are other really good
reasons as well.
  For example, suppose that you wanted to make the spline points inside a
loop. You could do something like this:

spline
{ cubic_spline
  #declare Ind = 0;
  #while(Ind < 10)
    Ind, <Ind, Ind*Ind, 0>
    #declare Ind = Ind+1;
  #end
}

  Now suppose that the commas were mandatory. That wouldn't work anymore.
It won't work either if you add a comma after the vector.
  I'll let it as an exercise how complicated that would need to be done if
commas were mandatory.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.